/**
*	@class OpenGLRenderer
*
*	@brief
*
*	@author William McVicar
*/

#pragma once

#ifndef __OPENGLRENDERER_H_INCLUDED__
#define __OPENGLRENDERER_H_INCLUDED__

#ifdef OPENGL

//  Library Includes
#include <gl\GL.h>

//  Local Includes
#include "IRenderer.h"
#include "Image.h"

//  Macros

//  Forward Declarations
class RendererData;

//  Types

//  Constants

//  Prototypes
namespace Protein
{

class Mesh;
class Texture2D;

template< typename T >
class Vector;

class OpenGLRenderer : public IRenderer
{
	//Member Functions
public:

	OpenGLRenderer();
	~OpenGLRenderer();

	virtual HRESULT Initialise( HWND hWnd );
	virtual void Render();


	void Resize( i32 _iWindowWidth, i32 _iWindowHeight );

	static int checkGLErrors();
	static GLenum getGLInternalFormat( ePixelFormat pixelFormat );
	static GLenum getGLDataFormat( ePixelFormat pixelFormat );
	static GLenum getGLDataType( ePixelFormat pixelFormat);


protected: 

	bool Stuff();

private: 

	//Member Variables
public:

#ifdef PROTEIN_PLATFORM_WINDOWS
	typedef const char* (APIENTRY* PFNWGLGETEXTENSIONSSTRINGARBPROC)(HDC hdc);
	static PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB;
#endif

protected: 

private: 

	RendererData*     m_rendererData;

	i32		            m_iWindowWidth;
	i32		            m_iWindowHeight;

	Mesh*					    m_pMesh;
	Texture2D*				m_pTexture;

};

}

#endif

#endif //__OPENGLRENDERER_H_INCLUDED__
